<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateCommunityAppliesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('community_apply', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('user_id')->comment('用户id');
            $table->unsignedBigInteger('community_id')->comment('社区id');
            $table->unsignedTinyInteger('apply_role')->default(1)->comment("角色类型:1-业主，2-超级邻居，3-社区管理员");
            $table->unsignedTinyInteger('status')->default(0)->comment('申请状态：0-申请中，1-申请成功，2-拒绝');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('community_applies');
    }
}
